<html>
 <head>
    <title>[var.TITLE]</title>
    <link href="[var.ROOT_CSS_DIR]/main.css" rel="STYLESHEET" type="text/css" charset="iso-8859-1" hreflang="en-us">
    <link href="[var.ROOT_CSS_DIR]/facet/style.css" rel="STYLESHEET" type="text/css" charset="iso-8859-1" hreflang="en-us">
    <script type="text/javascript" src="[var.ROOT_DIR]js/common.js"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/doiMenuDOM.js"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/functions.js"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/jsmenu.php"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/jsmenu.cfg"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/jsformgrid.php?session=[var.SessionVar]"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/jsmasks.js"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/jsverify.php?session=[var.SessionVar]"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/jsinit.php?session=[var.SessionVar]"></script>
    <script type="text/javascript" src="[var.ROOT_DIR]js/jquery.min.js"></script>
 </head>
 <body bgcolor="FFFFFF" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

    <table border="0" cellspacing="0" cellpadding="0" width="100%" align="[var.POSITION]">
        <tr>
            <td>[tbs_include.onshow;file=[var.HTMLHeader];getob;]</td>
        </tr>
        <tr>
            <td>
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tr>
                    <td class="mainmenu2"><img src="images/spacer.gif" height="1" width="1"></td>
                </tr>
                <tr>
                    <td background="[var.ROOT_IMG_DIR]/back-menu.gif">
                    <table border="0" cellspacing="0" cellpadding="0" width="100%">
                        <tr>
                            <td>
                            <script language="JavaScript" type="text/JavaScript">menu.Build();</script>
                          </td>
                          <td class="head-login">Login as [var.USERPROFILE_NAME]</td>
                        </tr>
                      </table>
                    </td>
                </tr>
                <tr>
                    <td class="mainmenu2"><img src="images/spacer.gif" height="1" width="1"></td>
                </tr>
            </table>
            </td>
        </tr>
        <tr height="100%">
            <td>
            <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
                <tr valign="top">
                    <td width="100%">
                        <table border="0" cellspacing="0" cellpadding="0" width="100%">
                            <tr>
                                <td class="head-path"></td>
                                <td class="corner-date">[var.CORNER_DATE]</td>
                            </tr>
                        </table>

                        <table border="0" cellspacing="0" cellpadding="5" width="100%">
                            <tr>
                                <td class="FacetHeaderContent" >.:[var.SubHeaderTitle]:.</td>
                            </tr>
                        </table>

                        <table border="0" cellspacing="0" cellpadding="5" width="100%">
                            <tr>
                                <td class="contentTitle">
                                Menu
                                </td>
                            </tr>

                            <tr>
                                <td class="content2">
                                <table cellspacing="2" cellpadding="0">
                                 <tr>
                                   <td>
                                    <input type="button" name="Action" value="<<Back" class="button" onClick="self.location.replace('[sys.script_name]')">
                                   </td>
                                   <td>
                                    <input type="button" name="Action" value="Done" class="button" onClick="self.location.replace('[var.SERVER_URL]')">
                                   </td>

                                   <td>[tbs_check;block=td;if [var.USER_CANPRINT]=1]
                                    <input type="button" name="Action" value="Print Receipt Voucher" class="button" onClick="OpenPDF('[sys.script_name]?PageMode=PDF&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&office=[var.KTRASL]'); updateFlagPrint()">
                                   </td>
                                   <td>[tbs_check;block=td;if [var.USER_CANPRINT]=1]
                                    <input type="button" name="Action" value="Print Tax Voucher" class="button" onClick="OpenPDF('[sys.script_name]?PageMode=Tax&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&office=[var.KTRASL]&cashType='+getCashType())">
                                   </td>
                                   <td>[tbs_check;block=td;if [var.USER_CANPRINT]=1]
                                    <input type="button" name="Action" value="Create New Tax Number" class="button" onClick="return confirmCreateTax()">
                                   </td>


                                   <td>[tbs_check;block=td;if [var.USER_CANPRINT]=1]
                                    <input type="button" name="Action" value="New Receipt" class="button" onClick="self.location.replace('[sys.script_name]?PageMode=Form')">
                                   </td>
                                 </tr>
                                </table>
                                </td>
                            </tr>

                            <tr>
                                <td class="content2">
                                    <!-- FORM SECTION -->
                                    <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                    <form method="post" action="[var.FormAction]" name="[var.HTMLFormName]" ONSUBMIT="if (this.submitted) return true; else return false;">
                                          <tr>
                                            <td class="fieldCaption" align="right">ID No.</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                                <input type="text" name="[headbln.nokwit]" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.nokwit] ;else 'AUTO NUMBERED BY SYSTEM']" maxlength="255" size="25" class="input" onkeyup="this.value=this.value.toUpperCase()" class="input" readonly>
                                                                                        <input type="hidden" name="app1" value="[headblv.app1]">
                                                                                        <input type="hidden" name="nmapp1" value="[headblv.nmapp1]">
                                            </td>
                                            <td class="fieldCaption" align="right">Opr. Contr.</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                                    <input type="text" name="[headbln.principal]" value="[headblv.principal]" maxlength="255" size="35" class="input" onclick="GetPrincipal();">
                                                    <input type="hidden" name="[headbln.principal_code]" value="[headblv.principal_code]">
                                            </td>
                                          </tr>

                                          <tr>
                                            <td class="fieldCaption" align="right">Transaction Date</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                            <input type="text" name="[headbln.tglkwit]" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.tglkwit;frm='dd/mm/yyyy']; else [sys.now;frm='dd/mm/yyyy']]" maxlength="255" size="10" class="input" onload="if( CheckPeriodDate() ) {document.ReceiptForm.tglkwit.readOnly = false }">
                                                <a href="javascript:void(0)" name="kozhie19" onclick="gfPop.fPopCalendar([var.HTMLFormName].[headbln.tglkwit]);return false;" hidefocus>
                                                <img name="popcal" id='popcal' align="absMiddle" src="[var.ROOT_DIR]js/Calendar/pop/calbtn.gif" width="34" height="22" border="0" alt="" onload="ImageVisible()"></a>

                                            </td>

                                            <td class="fieldCaption" align="right">Customer Type</td>
                                            <td class="fieldCaption">:</td>
                                            <td class="fieldCaption">
                                            <select name="customer_type" class="input" onchange="GetReceived(this.value)">
                                                <option value="">-</option>
                                                <option value="Debtur">Debtur</option>
                                                <option value="Other">Other</option>
                                            </select>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td class="fieldCaption" align="right">Location</td>
                                            <td class="fieldCaption">:</td>
                                            <td class="fieldCaption">
                                            <select name="location" class="input" >
                                                <option value="">-</option>
                                                  <option value="[locblk.SDCODE]">[locblk.SDNAME;block=option]</option>
                                                  <option>[tbs_check;if [headblv.location]!='';then [headblv.location] ;else '';selected;noerr]</option>
                                             </select>
                                            </td>

                                            <td class="fieldCaption" align="right">Customer Code</td>
                                            <td class="fieldCaption">:</td>
                                            <td class="fieldCaption">
                                                <input type="text" name="[headbln.debtur]" value="[headblv.debtur]" maxlength="255" size="10" class="input" onchange="this.value=this.value.toUpperCase()">
                                            </td>
                                          </tr>

                                          <tr>
                                            <td class="fieldCaption" align="right" valign="top">Currency</td>
                                            <td class="fieldCaption" width="2" valign="top">:</td>
                                            <td class="fieldCaption" valign="top">
                                            <select name="[headbln.curr]" class="input" onchange="GetRate()">
                                                <option value="">-</option>
                                                  <option value="[currformblk.tusymbol]">[currformblk.tusymbol;block=option]</option>
                                                  <option>[tbs_check;if [headblv.curr]!='';then [headblv.curr] ;else 'IDR';selected;noerr]</option>
                                            </select>

                                                <input type="text" name="[headbln.rate]" value="[tbs_check;if [headblv.rate]!='';then [headblv.rate;frm='0,000.00'] ;else '1.00']" maxlength="255" size="10" class="inputNumber" readonly>
                                            </td>

                                            <td class="fieldCaption" align="right">Customer</td>
                                            <td class="fieldCaption">:</td>
                                            <td class="fieldCaption">
                                                <input type="text" name="[headbln.debnam]" value="[headblv.debnam]" maxlength="255" size="40" class="input" onchange="this.value=this.value.toUpperCase()">
                                            </td>
                                          </tr>

                                          <tr>
                                            <td class="fieldCaption" align="right" valign="top">Remark</td>
                                            <td class="fieldCaption" width="2" valign="top">:</td>
                                            <td class="fieldCaption" valign="top">
                                                <textarea name="[headbln.remark1]" class="input" rows=3 cols=50 onchange="this.value=this.value.toUpperCase()">[headblv.remark1]</textarea>
                                            </td>



                                            <td class="fieldCaption" align="right" valign="top">Address</td>
                                            <td class="fieldCaption" width="2" valign="top">:</td>
                                            <td class="fieldCaption" valign="top">
                                                <textarea name="[headbln.alamat]" class="input" rows=3 cols=35 onchange="this.value=this.value.toUpperCase()">[headblv.alamat]</textarea>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td class="fieldCaption" align="right" valign="top"></td>
                                            <td class="fieldCaption" width="2" valign="top"></td>
                                            <td class="fieldCaption" width="2" valign="top"></td>

                                            <td class="fieldCaption" align="right">NPWP</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                            <input type="text" name="[headbln.npwp]" value="[headblv.npwp]" maxlength="255" size="15" class="input" readonly>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td class="fieldCaption" align="right">Payment By</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                                <select name="[headbln.payby]" class="input" onchange="SwitchGiroCash(this.value)">
                                                    <option value="">-</option>
                                                    <option value="Cash">Cash</option>
                                                    <option value="Cek / BG">Cek / BG</option>
                                                    <option>[tbs_check;if [headblv.payby]!='';then [headblv.payby] ;else 'Cash';selected;noerr]</option>
                                                </select>
                                            </td>

                                            <td class="fieldCaption" align="right">VAT No.</td>
                                            <td class="fieldCaption"></td>
                                            <td class="fieldCaption">
                                            <input type="text" name="[headbln.faktur]" value="[headblv.faktur]" maxlength="255" size="25" class="input" readonly >
                                            </td>
                                          </tr>

                                          <tr>
                                            <td class="fieldCaption" align="right">Tarif Package</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                                <select name="[headbln.payby]" class="input" onchange="SwitchGiroCash(this.value)">
                                                    <option value="">-</option>
                                                    <option value="Cash">Cash</option>
                                                    <option value="Cek / BG">Cek / BG</option>
                                                    <option>[tbs_check;if [headblv.payby]!='';then [headblv.payby] ;else 'Cash';selected;noerr]</option>
                                                </select>
                                            </td>
                                          </tr>

                                          <tr id="girofields">
                                            <td class="fieldCaption" align="right">No Cek</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                            <input type="text" name="[headbln.nocek]" value="[headblv.nocek]" maxlength="255" size="25" class="input" onkeyup="this.value=this.value.toUpperCase()">
                                            </td>

                                            <td class="fieldCaption" align="right">Due Date</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                            <input type="text" name="[headbln.duedate]" value="[headblv.duedate;frm='dd/mm/yyyy']" maxlength="255" size="10" class="input" onkeyup="this.value=this.value.toUpperCase()">
                                                <a href="javascript:void(0)" onclick="gfPop.fPopCalendar([var.HTMLFormName].[headbln.duedate]);return false;" hidefocus>
                                                <img name="popcal" align="absMiddle" src="[var.ROOT_DIR]js/Calendar/pop/calbtn.gif" width="34" height="22" border="0" alt=""></a>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td class="fieldCaption" align="right"><span>[tbs_check;block=span;if [var.USER_CANPRINT]=1]Jenis</span></td>
                                            <td class="fieldCaption" width="2"><span>[tbs_check;block=span;if [var.USER_CANPRINT]=1]:</span></td>
                                            <td class="fieldCaption">
                                                  <select class="input" name="cash_type">[tbs_check;block=select;if [var.USER_CANPRINT]=1]
                                                    <option value="1">Harga Jual</option>
                                                    <option value="2">Penggantian</option>
                                                    <option value="3">Uang Muka</option>
                                                    <option value="4">Termijn</option>
                                                    <option>[headblv.cash_type;selected;noerr]</option>
                                                  </select>
                                            </td>

                                            <td class="fieldCaption" align="right">Include PPN</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                               <input type="checkbox" name="IncPPN" value="1" [tbs_check;if [headblv.noppn]=1;then 'checked' ;else '']>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td>
                                            <td class="fieldCaption" align="right">VAT Date</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                            <input type="text" name="[headbln.tglvat]" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.tglvat;frm='dd/mm/yyyy']; else [sys.now;frm='dd/mm/yyyy']]" maxlength="255" size="10" class="input" onChange="CheckPeriodVAT()">
                                            <a href="javascript:void(0)" onClick="gfPop.fPopCalendar([var.HTMLFormName].[headbln.tglvat]);return false;" hidefocus><img name="popcal" align="absMiddle" src="[var.ROOT_DIR]js/Calendar/pop/calbtn.gif" width="34" height="22" border="0" alt=""></a>
                                            </td>
                                          </tr>
                                          <!--
                                          <tr>
                                            <td class="fieldCaption" align="right"></td>
                                            <td class="fieldCaption" width="2"></td>
                                            <td class="fieldCaption">
                                            </td>

                                            <td class="fieldCaption" align="right">VAT Date</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                            <input type="text" name="[headbln.tglkwit]" value="[tbs_check;if [var.FormMode]=Edit;then [headblv.tglkwit;frm='dd/mm/yyyy']; else [sys.now;frm='dd/mm/yyyy']]" maxlength="255" size="10" class="input" onblur="CheckPeriod();">
                                                <a href="javascript:void(0)" onclick="gfPop.fPopCalendar([var.HTMLFormName].[headbln.tglkwit]);return false;" hidefocus>
                                                <img name="popcal" align="absMiddle" src="[var.ROOT_DIR]js/Calendar/pop/calbtn.gif" width="34" height="22" border="0" alt=""></a>

                                            </td>
                                          </tr>
                                          -->

                                          <tr>[tbs_check;block=tr;if [var.FormMode]!='Edit']
                                            <td class="fieldCaption" align="right">Create Cash Received</td>
                                            <td class="fieldCaption" width="2">:</td>
                                            <td class="fieldCaption">
                                            <!-- <input type="checkbox" name="CreateTK" value="1" checked> -->
                                            <input type="checkbox" name="CreateTK" value="1" >
                                          </tr>

                                     </table>
                                     <!-- FORM SECTION -->
                                </td>
                            </tr>
                        </table>

                        <hr size="1" color="DFDFDF">
                        <div id="spanHeader" style="height: 25px; vertical-align: top; overflow-y: noscroll;">
                        <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="left">
                        <input type=hidden name="NewData" value="[var.NewDataStart]">
                            <tr>
                                <td nowrap class="FacetColumnTD" align="center" width="20">X</td>
                                <td nowrap class="FacetColumnTD" align="center" width="20">No.</td>
                                <td nowrap class="FacetColumnTD" align="center" width="180">Description</td>
                                <td nowrap class="FacetColumnTD" align="center" width="80">Latter No.</td>
                                <td nowrap class="FacetColumnTD" align="center" width="80">AMOUNT</td>
                                <td nowrap class="FacetColumnTD" align="center" width="80">COA</td>
                            </tr>
                        </table>
                        </div>
                        <div id="spanDetail" style="height: 200px; vertical-align: top; overflow: auto;">
                        <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="left">
                            <tr id="[blg.#]" style="display:[blg._display;noerr]">
                                <td nowrap class="FacetDataTD" align="right" width="30" align="center">
                                <input type="checkbox" name="txtCheck[blg.#]" value="[blg.receipt_id;noerr]" class="inputRadio">
                                <input type="hidden" name="receipt_id[blg.#]" value="[blg.receipt_id;noerr]" maxlength="255" size="25">
                                <input type=hidden name="NewData" value="[var.NewDataStart]">
                                <input type="hidden" name="urut[blg.#]" value="[blg.#;noerr]" maxlength="255" size="15" class="input">
                                <input type="hidden" name="princ[blg.#]" value="[blg.princ;noerr]" maxlength="255" size="15" class="input">
                                <input type="hidden" name="inc_ppn[blg.#]" value="[blg.inc_ppn;noerr]" maxlength="255" size="15" class="input">
                                <input type="hidden" name="kdact[blg.#]" value="[blg.kdact;noerr]" maxlength="255" size="15" class="input">
                                </td>
                                <td nowrap class="FacetDataTD" align="right" width="30" align="center">[blg.#].</td>
                                <td nowrap class="FacetDataTD" align="left" width="240">
                                <select name="thbl[blg.#]" class="input" onchange="GetSkada(this.value,[blg.#])">
                                    <option value="">Select Value</option>
                                    <option value="[receiptblk.kdreceipt]">[receiptblk.receiptname;block=option]</option>
                                    <option>[blg.thbl;selected;noerr]</option>
                                    <option value="O">Other</option>
                                </select>
                                <input type="text" name="uraian[blg.#]" value="[blg.uraian;noerr;block=tr]" maxlength="255" size="10" class="input" onchange="this.value=this.value.toUpperCase()">
                                <input type="text" name="uraian_tools[blg.#]" value="[blg.uraian_tools;noerr]" maxlength="255" size="10" class="input" onchange="this.value=this.value.toUpperCase()">
                                <a href="javascript:OpenCalc('[var.HTMLFormName]','uraian_tools[blg.#]', 'jumlah[blg.#]','cbm[blg.#]','jenis[blg.#]','dol[blg.#]',document.[var.HTMLFormName].IncPPN.checked,document.[var.HTMLFormName].skada[blg.#].value)"><img src="[var.ROOT_IMG_DIR]/tigracalc.gif" align="middle" border=0></a>
                                <input type="hidden" name="cbm[blg.#]" value="[blg.cbm;noerr]" maxlength="255" size="15" class="input">
                                <input type="hidden" name="dol[blg.#]" value="[blg.dol;noerr]" maxlength="255" size="15" class="input">
                                <input type="hidden" name="jenis[blg.#]" value="[blg.jenis;noerr]" maxlength="255" size="15" class="input">
                                </td>
                                <td class="FacetDataTD" width="110" align="center">
                                <input type="text" name="container_no[blg.#]" value="[blg.container_no;noerr]" maxlength="255" size="20" class="input">
                                </td>
                                <td class="FacetDataTD" width="110" align="center">
                                <input type="text" name="jumlah[blg.#]" value="[blg.jumlah;noerr;frm='0,000.00']" maxlength="255" size="10" onkeyup="var jumlah=SumTotal ('jumlah');this.form.total_trans.value = jumlah[0];this.form.total_ppn.value = jumlah[1];" class="inputNumber">
                                </td>
                                <td class="FacetDataTD" width="110" align="center">
                                <input type="text" name="skada[blg.#]" value="[blg.skada;noerr]" maxlength="255" size="10" class="input" onclick="this.blur();openSkada([blg.#]);" onkeyup="this.blur();openSkada([blg.#]);">
                                </td>
                            </tr>
                        </table>
                        </div>

                        <div id="spanButton" style="height: 35px; vertical-align: top; overflow-y: noscroll;">
                        <table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="left">
                            <tr>
                                <td align="right" class="FacetDataTD">Total PPN:  <input type="text" name="total_ppn" value="" maxlength="255" size="15" class="inputNumber"></td>
                            </tr>

                            <tr>
                                <td align="right" class="FacetDataTD">Total Amount:  <input type="text" name="total_trans" value="" maxlength="255" size="15" class="inputNumber"></td>
                            </tr>

                            <tr>
                                <td align="right" class="FacetColumnTD">
                                <!-- Add by Chandra (25 March 2009)-->
                                <input type="hidden" name="[headbln.flag_has_print]" value="[headblv.flag_has_print]" />
                                <table border="0" cellspacing="2" cellpadding="0">[tbs_check;block=table;if [var.PERIOD_OPENED]=1]
                                    <tr>
                                        <td>[tbs_check;block=td;if [var.USER_CANINSERT]=1]
                                        <input name="FormAction" type="submit" value="Next Line" class="button" onclick="if(!hasPrint()){ if(CheckPeriod ()){return AddFormGrid(this,'[var.HTMLFormName].uraian')} }else{ return warningPrint(); }">
                                        </td>
                                        <td>[tbs_check;block=td;if [var.USER_CANUPDATE]=1]
                                        <input name="FormAction" type="submit" value="Save" class="button" ONCLICK="if(!hasPrint()){ if (VerifyForm(this.form) && CheckPeriod ()) {this.form.submitted=true; return true;} }else{ return warningPrint(); }">
                                        </td>
                                        <td>[tbs_check;block=td;if [var.USER_CANDELETE]=1]
                                        <input type="button" name="Action" value="Delete" class="button" onClick="if(!hasPrint()){ if (confirm('Are you sure want to delete ?')) {[var.HTMLFormName].action='[sys.script_name]?FormAction=Delete&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&PageMode=Form&form=[var.HTMLFormName]';[var.HTMLFormName].submit();} }else{ return warningPrint(); }">
                                        </td>
                                        <td>
                                        <input name="FormAction" type="submit" value="Cancel" class="button" onClick="self.location.replace('[sys.script_name]')">
                                        </td>
                                    </tr>
                                </table>
                                </td>
                                </td>
                            </tr>
                            </form>
                        </table>
                        </div>
                    </td>
                </tr>
            </table>
            </td>
        </tr>
        <tr>
            <td>
            <br>
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tr>
                    <td class="footer1"><img src="images/spacer.gif" height="1" width="1"></td>
                </tr>
                <!--tr>
                    <td class="footer2">Prototype Test - Web Application</td>
                </tr-->
            </table>
            </td>
        </tr>
    </table>
 </body>
 <iframe width="174" height="189" name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="[var.ROOT_DIR]js/Calendar/pop/ipopeng.htm" scrolling="no" frameborder="0" style="LEFT: -500px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; Z-INDEX: 999"></iframe>
 <script>
//Rama, 24 December 2009, Start
 function CheckPeriodDate() {
    //if (ledger.length)  LoadRPC ("iLoader", "[var.FileName]", "ledger="+ledger+"&trsto=tglkwit");
     var ledger = document.[var.HTMLFormName].tglkwit.value;
     var value = "open";

     var param = 'ledger='+ledger;
     $.ajax({ type: "post", url: "ais_transaction_check_period.php", data: param, dataType: "xml",
         success: function(xml){
            $('status', xml).each(function(i){
               value = $('periodstatus', this).text();
            });
        },
        async:   false,
     });

     if(value == "open"){
        return true;
     }else{
        //alert('Invalid Date, Period Already Closed Or Not Yet Opened!');
        return false;
     }
 }

 function ImageVisible() {
 if(CheckPeriodDate()){
     alert('kozhieee');
    document.getElementById("popcal").style.visibility = "visible";
    } else {
    alert('ramaaaa');
    document.getElementById("popcal").style.visibility = "hidden";
    }
 }

//Rama, 24 December 2009, Finish

 function CheckPeriodVat () {
         ledger = document.[var.HTMLFormName].tglvat.value;
         if (ledger.length) LoadRPC ("iLoader", "[var.FileName]", "ledger="+ledger+"&trsto=tglvat");
 }


 [var.InitFunction]
 // Add by Chandra (25 March 2009)
 function hasPrint(){
    var flag = document.[var.HTMLFormName].flag_has_print.value;
    //return (flag == 'Yes');
    return false;
 }
 function updateFlagPrint(){
    document.[var.HTMLFormName].flag_has_print.value = 'Yes';
 }
 function warningPrint(){
    alert("Cannot Update This Receipt Because Receipt Voucher Has Printed Before");
    return false;
 }

 //dyah.24 juli 2009, modified 27 july 2009
 function CheckPeriod () {
     //if (ledger.length)  LoadRPC ("iLoader", "[var.FileName]", "ledger="+ledger+"&trsto=tglkwit");
     var ledger = document.[var.HTMLFormName].tglkwit.value;
     var value = "open";

     var param = 'ledger='+ledger;
     $.ajax({ type: "post", url: "ais_transaction_check_period.php", data: param, dataType: "xml",
         success: function(xml){
            $('status', xml).each(function(i){
               value = $('periodstatus', this).text();
            });
        },
        async:   false,
     });

     if(value == "open"){
        return true;
     }else{
        alert('Invalid Date, Period Already Closed Or Not Yet Opened!');
        return false;
     }
 }

 function GetTotal() {
    var jumlah = SumTotal("jumlah");
    document.[var.HTMLFormName].total_ppn.value = jumlah[1];
    document.[var.HTMLFormName].total_trans.value = jumlah[0];

 }

function GetTotal() {
    var jumlah = SumTotal("jumlah");
    document.[var.HTMLFormName].total_ppn.value = jumlah[1];
    document.[var.HTMLFormName].total_trans.value = jumlah[0];

 }

 SwitchGiroCash (document.[var.HTMLFormName].payby.value);
 var jumlah = SumTotal("jumlah");
 document.[var.HTMLFormName].total_trans.value = jumlah[0];
 document.[var.HTMLFormName].total_ppn.value = jumlah[1];

 function GetReceived(val) {
        if (val=="Debtur") {
            newwin = window.open("ais_transaction_custlist.php?FormName=[var.HTMLFormName]","toolcalc","height=400,width=640,noscroll,resizable");
        }

 }

 function GetPrincipal() {
    newwin = window.open("ais_transaction_principal.php?FormName=[var.HTMLFormName]","toolcalc","height=400,width=640,noscroll,resizable");
 }

  function SwitchGiroCash (val) {
     if (val=="Cek / BG") {
        document.getElementById("girofields").style.display = "";
              document.[var.HTMLFormName].nocek.disabled = false;
              document.[var.HTMLFormName].duedate.disabled = false;
     } else {
         document.getElementById("girofields").style.display = "none";
         document.[var.HTMLFormName].nocek.disabled = true;
         document.[var.HTMLFormName].duedate.disabled = true;
     }
  }
function CheckFakturNo(turl) {
    var faktur;
    faktur = document.[var.HTMLFormName].faktur.value;
    if (faktur.length>0) {
        OpenPDF(turl);
    } else alert('Please create a');
}

function OpenCalc(formname, desc, total, act, qty, tarif,isPPN,skadappn) {
  PPNValue = (isPPN==true)?1:0;
    newwin = window.open("ais_transaction_calc.php?PageMode=Form&desc="+desc+"&total="+total+"&act="+act+"&qty="+qty+"&tarif="+tarif+"&formname="+formname+"&ppnvalue="+PPNValue+"&skada="+skadappn,"toolcalc","height=10,width=450,noscroll,resizable")
}

 function OpenPrincipal (number) {
    newwin = window.open("ais_transaction_receipt_entry.php?PageMode=Page2&FormName=[var.HTMLFormName]&Number="+number,"vessel","height=105,width=300,noscroll,noresizable");
 }

 function OpenPrint (number) {
    newwin = window.open("ais_transaction_receipt_entry.php?PageMode=PrintPreview&nobkt="+number,"print","height=650,width=600,noscroll,noresizable");
 }

 function GetRate() {
     tgl_curr = document.[var.HTMLFormName].tglkwit.value;
     if (tgl_curr.length) LoadRPC ("iLoader", "[var.FileName]", "curr="+document.[var.HTMLFormName].curr.value+"&tglbkt="+tgl_curr);
 }

 function GetSkada(activity,idx) {
     skada1 = activity;
     if (skada1.length) LoadRPC ("iLoader", "[var.FileName]", "thbl="+activity+"&idx="+idx);
 }

 function SumTotal (component) {
     oMask = new Mask('#,###.###0', 'number');
     var comp_str = "document.[var.HTMLFormName]."+component;
     var ppn_str  = "document.[var.HTMLFormName].inc_ppn";
     var returned;

     var TotalComponent = [var.MaxGrid] + [var.NewDataStart] - 1;
     var sum_all = 0;
     var sumppn_all = 0;
     var subtotal = 0;
     var ppntotal = 0;
     var js_str = "";

     for (x=1;x<=TotalComponent;x++) {
       js_str = "subtotal = "+comp_str+x+".value";
       ppn_js_str = "ppn_flag = "+ppn_str+x+".value";
       eval (js_str);eval (ppn_js_str);


       if (subtotal.length) {
           subtotal = StrToNumber(subtotal);
           if (ppn_flag==1) {
               ppntotal = subtotal*10/100;
               sumppn_all = sumppn_all + parseFloat(ppntotal);
           }

        } else {subtotal = 0;ppntotal = 0;}

       sum_all = sum_all + parseFloat(subtotal);
     }
     grandtotal = sum_all + sumppn_all;
     return Array(oMask.format(grandtotal),oMask.format(sumppn_all));
 }

 function openSkada(idx) {
    tglbkt = document.[var.HTMLFormName].tglkwit.value;
    newwin = window.open("ais_transaction_coapicker.php?idx="+idx+"&FormName=[var.HTMLFormName]"+"&Field=skada"+idx+"&BMode=MEM"+"&period="+tglbkt,"skadasearch","height=400,width=640,noscroll,noresizable");
 }

 function confirmCreateTax() {
  if (confirm('Are you sure want to create tax number again ?'))
    self.location.replace('[sys.script_name]?PageMode=Form&Action=CreateFaktur&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&[var.PRIMARY_KEY]=[var.PRIMARY_VALUE]&office=[var.KTRASL]');
  else return false
 }

 function getCashType(){
    var frm = document.[var.HTMLFormName].cash_type;
    return frm.options[frm.selectedIndex].value;
 }

 function checkTrans(){

 }


 </script>
</html>
